<template>
	<view style="width: 100%;background: red">
		<!-- #ifdef H5 -->
		<com-top-bar @backFn="backFn" ref="topbar">{{title}}</com-top-bar>
		<!-- #endif -->
		<view class="web-box" :style="{top:barHeight,marginTop:barHeight+'px',height:`calc(100vh - ${barHeight}px)`}">
			<web-view :src="src"></web-view>
		</view>

	</view>
</template>

<script>
	import ComTopBar from "../../components/ComTopBar/ComTopBar";
	export default {
		name: "Xweb",
		components: {
			ComTopBar
		},
		data() {
			return {
				title: '西部食谷微官网',
				src: "",
				barHeight: 0
			};
		},
		onLoad(op) {
			if (op.title) {
				this.title = op.title
			}
			this.src = uni.getStorageSync("webSrc")
      console.log("this.src",this.src)
		},
		mounted() {
			// #ifdef H5
			this.barHeight = this.$refs.topbar.topBarHeight
			console.log("topBarHeight", this.barHeight);
			// #endif
		},
		methods: {
			backFn() {
				console.log("clickbackFn")
				uni.navigateBack()
			},
			msgFn(e) {
				console.log("msgFn", msgFne);
			}
		}
	}
</script>

<style lang="scss">
	.web-box {
		position: absolute;
		margin-top: 100rpx;
		top: 90rpx;
		left: 0;
		width: 100%;
		height: 100vh;
	}
</style>
